package com.mandao.concurrency.example.publish;

import com.mandao.concurrency.annotations.NotThreadSafe;
import com.sun.org.apache.bcel.internal.classfile.InnerClass;
import lombok.extern.slf4j.Slf4j;

/**
 *  对象逸出
 *      在一个对象没有完全构造成功的时候 禁止发布
 */
@Slf4j
@NotThreadSafe
public class Escape {
    private int thisCanEscape = 0;

    public Escape(){
        new InnerClass();
    }

    private class InnerClass{
        public InnerClass(){
            log.info("{}",Escape.this.thisCanEscape);
        }
    }

    public static void main (String[] args){
        new Escape();
    }

}
